// 全局加载网络库
import './utils/http'
// app.js
App({
  token: "",
  onLaunch() {
    this.getToken();
  },
  getToken() {
    wx.getStorage({
      key: 'token',
      success: ({ data }) => {
        this.token = data;
      },
      fail: () => { }
    })
  },
  setToken(token, refresh_token) {
    // 本地存储 token 和 refresh_token
    wx.setStorageSync('token', token)
    wx.setStorageSync('refresh_token', refresh_token)
    // 更新全局 token 和 refresh_token
    this.token = token
    this.refresh_token = refresh_token
  },
  globalData: {},
})
